<%@ page pageEncoding="UTF-8" %>
<%@ page import="java.util.*,jp.co.technotree.common.util.*,jp.co.technotree.apl.cmd.user.Usr1000Bean.*" %>
<jsp:useBean id="formBean" class="jp.co.technotree.apl.cmd.user.Usr1000Bean" scope="request" />
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="/jsp/common/include.jsp"></jsp:include>
<title></title>
<script type="text/javascript">

function pageNo_onClick(pageNo){
	document.forms[0].pageNo.value = pageNo;
	document.forms[0].submit();
}
function visibleCount_onChange(recordNo){
	document.forms[0].recordNo.value = recordNo;
	document.forms[0].submit();
}
function find_onClick(){
	document.forms[0].pageNo.value = 0;
	document.forms[0].submit();
}
function edit_onClick(findUserUCd){
	document.forms[0].findUserUCd.value = findUserUCd;
	document.forms[0].button.value = "edit";
	document.forms[0].submit();
}
function delete_onClick(findUserUCd){
	document.forms[0].findUserUCd.value = findUserUCd;
	document.forms[0].button.value = "delete";
	document.forms[0].submit();
}

</script>
</head>
<body>
<jsp:include page="/jsp/common/menu.jsp"></jsp:include>
<form method="post" action="usr1000">
<div id="content">
	<div id="pan">利用者 > 一覧</div>
	<h1><span class="shape1"></span>利用者情報一覧</h1>
	<h2><span class="shape2"></span>検索</h2>
	<div id="searchbox" class="contentbox1">
		<div class="searchelement">
			<div class="searchname">利用者コード</div>
			<input type="text" class="searchword size1" name="userCd" value="<%=formBean.getJspValue("userCd") %>">
		</div>
		<div class="searchelement">
			<div class="searchname">利用者名称</div>
			<input type="text" class="searchword size1" name="userName" value="<%=formBean.getJspValue("userName") %>">
		</div>
		<div class="searchelement">
			<div class="searchname">登録日</div>
			<input type="text" class="searchword size2"> ～ <input type="text" class="searchword size2">
		</div>
		<div class="searchelement">
			<div class="searchname">登録者</div>
			<input type="text" class="searchword size1">
		</div>
		<div class="searchbutton">
			<input type="button" value="検索" onClick="find_onClick()">
		</div>
	</div>
	<h2><span class="shape2"></span>メッセージ</h2>
	<div id="messagebox" class="contentbox1">
		<%=formBean.recordCount %>件の検索結果があります。<br>
		<%=formBean.message %>
	</div>
	<h2><span class="shape2"></span>検索結果</h2>
	<div class="contentbox2">
		<table>
			<tr><th>No</th><th>利用者コード</th><th>利用者名称</th><th>最終ログイン日</th><th>登録日</th><th>コマンド</th></tr>

<%
	UserRecord recordList[] = formBean.getRecordList();
	for ( int i=0; i<recordList.length; i++ ){
		UserRecord record = recordList[i];
%>
			<tr>
				<td align="center"><%=record.no %></td>
				<td><%=record.userCd %></td>
				<td><%=record.userName %></td>
				<td align="center"><%=record.lastLoginDate %></td>
				<td align="center"><%=record.entryDate %></td>
				<td align="center">
					<input type="button" value="選択" class="left" onClick="edit_onClick('<%=record.userUCd %>')">
					<input type="button" value="削除" onClick="delete_onClick('<%=record.userUCd %>')">
				</td>
			</tr>
<%	} %>
		</table>
	</div>
	<div id="pager">
		<span class="pager">
<% if ( formBean.pageNo > 0 ){ %>
			<a class="prev" onClick="pageNo_onClick(<%=formBean.pageNo-1 %>);"><<</a>
<% } %>
<% for ( int i=formBean.pageStart; i<=formBean.pageEnd; i++ ){
		String className = "";
		if ( formBean.pageNo == i ) className="this";
%>
			<a class="<%=className %>" onClick="pageNo_onClick(<%=i %>);"><%=i+1 %></a>
<%	} %>
<% if ( formBean.pageNo < formBean.pageMax ){ %>
			<a class="next" onClick="pageNo_onClick(<%=formBean.pageNo+1 %>);">>></a>
<% } %>
		</span>
		<select name="visibleCount" onChange="visibleCount_onChange(<%=formBean.recordNo %>)">
			<option value="10"  <%=formBean.visibleCount==10 ? "selected":"" %>>10件</option>
			<option value="20"  <%=formBean.visibleCount==20 ? "selected":"" %>>20件</option>
			<option value="30"  <%=formBean.visibleCount==30 ? "selected":"" %>>30件</option>
			<option value="50"  <%=formBean.visibleCount==50 ? "selected":"" %>>50件</option>
			<option value="100" <%=formBean.visibleCount==100? "selected":"" %>>100件</option>
		</select>
		<span>表示</span>
		<input type="hidden" name="pageNo" value="<%=formBean.pageNo %>"></input>
		<input type="hidden" name="recordNo" value="-1"></input>
	</div>
</div>
<input type="hidden" name="findUserUCd" value=""></input>
<input type="hidden" name="button" value=""></input>
<div id="footer">Copyright c 2012 TECHNOTREE CO., LTD. All Rights Reserved.</div>
</form>
</body>
</html>
